﻿@model IEnumerable<string>

@{
    bool horizontal = ((bool)(ViewContext.RouteData.Values["horizontalLayout"] ?? false));
    string wrapperClasses = horizontal ? "btn-group btn-group-sm btn-group-justified" : null;
}

<div class="@wrapperClasses">

    @Html.ActionLink("Home", "List", "Product",
    new {
        @class = horizontal ? "btn btn-default btn-sm" :
            "btn btn-block btn-default btn-lg"
    })

    @foreach (var link in Model) {
        @Html.RouteLink(link, new {
            controller = "Product",
            action = "List",
            category = link,
            page = 1
        }, new {
            @class = (horizontal ? "btn btn-default btn-sm"
                : "btn btn-block btn-default btn-lg")
                + (link == ViewBag.SelectedCategory ? " btn-primary" : "")
        })
    }

</div>
